## ELF Header
7f 45 4c 46        ## e_ident[EI_MAG0-3] ELF's magic number
02                 ## e_ident[EI_CLASS] Indicating 64 bit
01                 ## e_ident[EI_DATA] Indicating little endianness
01                 ## e_ident[EI_VERSION] Indicating original elf
00                 ## e_ident[EI_OSABI] Set at 0 because none cares
00                 ## e_ident[EI_ABIVERSION] See above
00 00 00 00 00 00 00
02 00              ## e_type Indicating Executable
3e 00              ## e_machine Indicating AMD64
01 00 00 00        ## e_version Indicating original elf
b0 00 40 00 00 00 00 00 ## e_entry Address of the entry point
40 00 00 00 00 00 00 00 ## e_phoff Address of program header table
00 00 00 00 00 00 00 00 ## e_shoff Address of section header table
00 00 00 00        ## e_flags
40 00              ## e_ehsize Indicating our 64 Byte header
38 00              ## e_phentsize size of a program header table
02 00              ## e_phnum number of entries in program table
40 00              ## e_shentsize size of a section header table
00 00              ## e_shnum number of entries in section table
00 00              ## e_shstrndx index of the section names

## Program Header table
01 00 00 00             ## p_type
05 00 00 00             ## Flags
00 00 00 00 00 00 00 00 ## p_offset
00 00 40 00 00 00 00 00 ## p_vaddr
00 00 40 00 00 00 00 00 ## Undefined
11 01 00 00 00 00 00 00 ## p_filesz
11 01 00 00 00 00 00 00 ## p_memsz
00 00 20 00 00 00 00 00 ## Required alignment

## BSS section header
01 00 00 00             ## p_type
06 00 00 00             ## Flags
14 01 00 00 00 00 00 00 ## p_offset
14 01 60 00 00 00 00 00 ## p_vaddr
14 01 60 00 00 00 00 00 ## Undefined
00 00 00 00 00 00 00 00 ## p_filesz
00 00 40 00 00 00 00 00 ## p_memsz (4MB)
00 00 20 00 00 00 00 00 ## Required alignment

:_start
e8 *getchar       	# callq  600133 <getchar>
48 83 f8 ff          	# cmp    $0xffffffffffffffff,%rax
74 ._start.done                	# je     6000cd <_start.done>
48 83 f8 20          	# cmp    $0x20,%rax
74 ._start                	# je     600078 <_start>
48 83 f8 09          	# cmp    $0x9,%rax
74 ._start                	# je     600078 <_start>
48 83 f8 0a          	# cmp    $0xa,%rax
74 ._start                	# je     600078 <_start>
48 83 f8 23          	# cmp    $0x23,%rax
74 .skip_comment                	# je     6000dd <skip_comment>
e8 *hex_digit       	# callq  6000f0 <hex_digit>
48 c1 e0 04          	# shl    $0x4,%rax
48 89 04 25 a0 01 60 	# mov    %rax,0x6001a0
00 
e8 *getchar       	# callq  600133 <getchar>
e8 *hex_digit       	# callq  6000f0 <hex_digit>
48 09 04 25 a0 01 60 	# or     %rax,0x6001a0
00 
48 8b 04 25 a0 01 60 	# mov    0x6001a0,%rax
00 
e8 *putchar       	# callq  60016f <putchar>
eb ._start                	# jmp    600078 <_start>
:_start.done
48 c7 c0 3c 00 00 00 	# mov    $0x3c,%rax
48 c7 c7 00 00 00 00 	# mov    $0x0,%rdi
0f 05                	# syscall 

:skip_comment
e8 *getchar       	# callq  600133 <getchar>
48 83 f8 ff          	# cmp    $0xffffffffffffffff,%rax
74 .die                	# je     600123 <die>
48 83 f8 0a          	# cmp    $0xa,%rax
74 ._start                	# je     600078 <_start>
eb .skip_comment                	# jmp    6000dd <skip_comment>

:hex_digit
48 83 f8 30          	# cmp    $0x30,%rax
7c .hex_digit.next1                	# jl     600101 <hex_digit.next1>
48 83 f8 39          	# cmp    $0x39,%rax
7f .hex_digit.next1                	# jg     600101 <hex_digit.next1>
48 83 e8 30          	# sub    $0x30,%rax
c3                   	# retq   
:hex_digit.next1
48 83 f8 61          	# cmp    $0x61,%rax
7c .hex_digit.next2                	# jl     600112 <hex_digit.next2>
48 83 f8 66          	# cmp    $0x66,%rax
7f .hex_digit.next2                	# jg     600112 <hex_digit.next2>
48 83 e8 57          	# sub    $0x57,%rax
c3                   	# retq   
:hex_digit.next2
48 83 f8 41          	# cmp    $0x41,%rax
7c .die                	# jl     600123 <die>
48 83 f8 46          	# cmp    $0x46,%rax
7f .die                	# jg     600123 <die>
48 83 e8 37          	# sub    $0x37,%rax
c3                   	# retq   

:die
48 c7 c0 3c 00 00 00 	# mov    $0x3c,%rax
48 c7 c7 01 00 00 00 	# mov    $0x1,%rdi
0f 05                	# syscall 

:getchar
48 c7 c0 00 00 00 00 	# mov    $0x0,%rax
48 c7 c7 00 00 00 00 	# mov    $0x0,%rdi
48 8d 34 25 98 01 60 	# lea    0x600198,%rsi
00 
48 c7 c2 01 00 00 00 	# mov    $0x1,%rdx
0f 05                	# syscall 
48 83 f8 01          	# cmp    $0x1,%rax
75 .getchar.getchar_fail                	# jne    600167 <getchar.getchar_fail>
48 c7 c0 00 00 00 00 	# mov    $0x0,%rax
8a 04 25 98 01 60 00 	# mov    0x600198,%al
c3                   	# retq   
:getchar.getchar_fail
48 c7 c0 ff ff ff ff 	# mov    $0xffffffffffffffff,%rax
c3                   	# retq   

:putchar
88 04 25 98 01 60 00 	# mov    %al,0x600198
48 c7 c0 01 00 00 00 	# mov    $0x1,%rax
48 c7 c7 01 00 00 00 	# mov    $0x1,%rdi
48 8d 34 25 98 01 60 	# lea    0x600198,%rsi
00 
48 c7 c2 01 00 00 00 	# mov    $0x1,%rdx
0f 05                	# syscall 
c3                   	# retq   

